/*
 * Copyright 2018 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

[data-i18n-prefix="DecisionNavigatorTreeView."] {

  /* ~ Tree ~ */

  [data-field="items"] {
    padding: .5em 1.5em;
  }

  ul {
    list-style: none;
    padding: 0 0 0 1.5em;
    line-height: 2em;

    li {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: default;
      user-select: none;
      padding-right: 1em;

      div {
        padding: 0 0.4em;
        line-height: 1.6em;
        border-radius: 0.25em;
        display: inline-block;

        input[data-field="input-text"] {
          border: 1px solid #CCC;
          background: #FFF;
          border-radius: 3px;
          border-bottom-color: #AAA;
          display: none;
        }

        &.selected,
        &.selected:hover {
          background: #DDF0F8
        }
      }

      .fa.fa-check,
      .fa.fa-pencil,
      .fa.fa-trash {
        margin-left: 2px;
        width: 15px;
        height: 10px;
        display: none;
        cursor: pointer;
      }

      i.fa.fa-trash {
        margin-top: -1px;
      }

      &:hover > div > [data-field="text-content"],
      &.editable:hover > div > [data-field="text-content"] {
        background: #EFEFEF;
      }

      &.editable:hover > .fa.fa-pencil,
      &.editable:hover > .fa.fa-trash {
        display: inline-block;
      }

      &.editable.editing > div > input[data-field="input-text"] {
        display: inline-block;
      }

      &.editable.editing > div > [data-field="text-content"] {
        display: none;
      }

      &.editable.editing > .fa.fa-pencil {
        display: none;
      }

      &.editable.editing > .fa.fa-trash,
      &.editable.editing > .fa.fa-check {
        display: inline-block;
      }
    }

    .parent-node {
      ul {
        display: block;
      }

      &.closed {
        ul {
          display: none;
        }
      }
    }

    /* ~ Icons ~ */

    li:before,
    [data-field="icon"]:before {
      font-family: FontAwesome;
      -webkit-font-smoothing: antialiased;
      padding-right: 0.5em;
      position: absolute;
    }

    li:before {
      margin: 0.1em 0 0 -2.25em;
      cursor: default;
    }

    [data-field="icon"]:before {
      margin: 0.1em 0 0 -1.5em;
      cursor: pointer;
    }

    li.parent-node:before {
      content: "\f0d7";
    }

    li.parent-node.closed:before {
      content: "\f0da";
    }

    li.kie-root > div > [data-field="icon"]:before {
      content: "\f0e8";
    }

    li.kie-item > div > [data-field="icon"]:before {
      content: "\f111";
    }

    li.kie-context > div > [data-field="icon"]:before {
      content: "\f192";
    }

    li.kie-decision-table > div > [data-field="icon"]:before {
      content: "\f0ce";
    }

    li.kie-invocation > div > [data-field="icon"]:before {
      content: "\f0a1";
    }

    li.kie-list > div > [data-field="icon"]:before {
      content: "\f0ca";
    }

    li.kie-function-definition > div > [data-field="icon"]:before {
      content: "f ( )";
      font-family: serif;
      font-style: italic;
      font-weight: bold;
      font-size: 1.2em;
      margin: -0.1em 0 0 -1.8em;
    }

    li.kie-literal-expression > div > [data-field="icon"]:before {
      content: "Σ";
      font-family: sans-serif;
      font-weight: bold;
      font-size: 1.2em;
      margin: 0 0 0 -1.15em;
    }

    li.kie-relation > div > [data-field="icon"]:before {
      content: "\f0c1";
      font-size: 1.2em;
      transform: rotate(-45deg);
      margin: -0.15em 0 0 -1.45em;
    }

    li.kie-text-annotation > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-business-knowledge-model > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-input-data > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-decision-service > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-knowledge-source > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-decision > div > [data-field="icon"]:before {
      width: 1.8em;
      height: 1.8em;
      content: url("");
    }

    li.kie-separator {
      margin-left: -28px;
      font-weight: bold;
      color: #888;

      div:hover {
        background: none;
      }
    }

    li.kie-separator[title="DRDs"] {
      border-top: 1px solid #CECECE;
      margin-top: 15px;
      padding-top: 10px;
    }
  }
}
